/**

This file is part of MaCI/GIMnet.

MaCI/GIMnet is free software: you can redistribute it and/or modify it 
under the terms of the GNU Lesser General Public License as published 
by the Free Software Foundation, either version 3 of the License, or 
(at your option) any later version.

MaCI/GIMnet is distributed in the hope that it will be useful, but WITHOUT 
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public 
License for more details.

You should have received a copy of the GNU Lesser General Public 
License along with GIMnet. (See COPYING.LESSER) If not, see 
<http://www.gnu.org/licenses/>.

**/
/*
*  \class	TLineParam
*  \author 	Jari Saarinen
*  \date 	Fri Jun 16 12:26:20 2006

*  \version: 	0.1  
*/


#include "TLineParam.h"




TLineParam::TLineParam(){
	this->a = 0; this->b=0; this->c=0;
}

TLineParam::TLineParam(float x1, float y1, float x2, float y2){

	endpoints2abc(x1, y1, x2, y2);	
}

TLineParam::~TLineParam()
{};
/**
* Convert the x,y end-startpoint pair 
*/
void TLineParam::endpoints2abc(float x1, float y1, float x2, float y2){
	TLineParam LP;
	LP.a = y2 - y1;
	LP.b = x1 - x2;
	LP.c = (-LP.a) * (x1) - (LP.b) * (y1);	
	this->a = LP.a;
	this->b = LP.b;
	this->c = LP.c;
}
